<?php 
$this->load->model('lookup_model');
$this->load->model('user_model');
$this->load->library('form_validation');
$gametype = $this->lookup_model->list_lookup(1);
$user = $this->user_model->get_user($bill['user_id']);
?>
<div class="container">
	<div class="module mod-line-top">
	<?//validation_errors('<div class="alert alert-danger">', '</div>'); ?>
	<?php
	if(isset($success) && $success){
		echo '<div class="alert alert-success">'.$success.'</div>';
	}
	?>
	
	
	<form id="home-form" name="home-form" action="<?=site_url('bill/editbill')?>" method="post" enctype="multipart/form-data">
		<input type="hidden" name="id" value="<?=$bill['id']?>"/>
		<input type="hidden" name="cmd" id="cmd" value="1"/>
		
		<h2>填写充值内容</h2>
		<div class="row">
			<div class="form-group col-lg-6">
				<label>联系邮箱</label>
				<input class="form-control" type="text" class="form-control" value="<?=$user['email']?>" disabled="true">	
			</div>
			<div class="form-group col-lg-6">
				<label>游戏账号</label>
				<input class="form-control" type="text" class="form-control" value="<?=$bill['account_no']?>" disabled="true">	
			</div>
			<div class="form-group col-lg-6">
				<label>游戏名称</label>
				<input class="form-control" type="text" class="form-control" value="<?=$gamename['l_value']?>" disabled="true">	
			</div>
			<div class="form-group col-lg-6">
				<label for="sg_money">汇率</label>
				<input type="text" type="text" class="form-control" value="<?=$bill['rate']?>" disabled="true">
			</div>
			<div class="form-group col-lg-6">
				<label for="sg_money">状态</label>
				<span><?=$statuslookup[$bill['status']]?></span>
			</div>
			<div class="form-group col-lg-6">
				<label for="sg_money">用户充值金额</label>
				<input type="text" class="form-control" value="<?=$bill['sg_money']?>" disabled="true">
			</div>
			<div class="form-group col-lg-6">
				<label>银行转账收据</label>
				<a href="/index.php/bill/download/receipt1/<?=$bill['id']?>" target="downloadframe">下载</a>
			</div>
			<div class="form-group col-lg-6">
				<label for="sg_money">客服充值金额</label>
				<input type="text" class="form-control" name="cn_money" value="<?=$bill['cn_money']?>">
			</div>
			<div class="form-group col-lg-6">
				<label for="receipt2">客服充值收据</label>
				<input type="file" id="receipt2" name="receipt2" class="form-control">
				<?if($bill['receipt2']){?>
				<p><a href="/index.php/bill/download/receipt2/<?=$bill['id']?>" target="downloadframe">下载</a></p>
				<?}?>
			</div>
			<div class="form-group col-lg-6">
				<label for="remark">备注</label>
				<input class="form-control" maxlength="500" name="remark" id="remark" type="text" value="<?=$bill['remark']?>">	
			</div>
		</div>
		<div class="form-actions">
			<button type="button" class="btn btn-primary" onclick="operate(1)">确定</button>
			<button type="button" class="btn" onclick="operate(2)">拒绝</button>
		</div>
	</form>
	</div>
</div>

<iframe name="downloadframe" style="display:none"></iframe>
<script type="text/javascript">
function operate(val){
	$('#cmd').val(val);
	$('#home-form').submit();
}
</script>
